﻿// (c) Norbert Huffschmid
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.

using System.Windows;

namespace SpinDotters.Widgets
{
    public partial class StopWatch
    {
        /// <summary>
        /// Gets the maximum high hours value
        /// </summary>
        public int HoursHighMaximum
        {
            get { return 9; }
        }

        /// <summary>
        /// Gets the fact whether a high hour value 0 should appear as blank
        /// </summary>
        public bool HoursHighShowZeroAsBlank
        {
            get { return false; }
        }

        /// <summary>
        /// Gets the high hours part
        /// </summary>
        public int HoursHigh
        {
            get { return (this.counter / 36000) % 10; }
        }

        /// <summary>
        /// Gets the low hours part
        /// </summary>
        public int HoursLow
        {
            get { return (this.counter / 3600) % 10; }
        }

        /// <summary>
        /// Gets the high minutes part
        /// </summary>
        public int MinutesHigh
        {
            get { return (this.counter / 600) % 6; }
        }

        /// <summary>
        /// Gets the low minutes part
        /// </summary>
        public int MinutesLow
        {
            get { return (this.counter / 60) % 10; }
        }

        /// <summary>
        /// Gets the high seconds part
        /// </summary>
        public int SecondsHigh
        {
            get { return (this.counter / 10) % 6; }
        }

        /// <summary>
        /// Gets the low seconds part
        /// </summary>
        public int SecondsLow
        {
            get { return this.counter % 10; }
        }

        /// <summary>
        /// Gets the AM/PM index
        /// </summary>
        public int AmPmIndex
        {
            get { return 0; } // not applicable
        }

        /// <summary>
        /// Gets the AM/PM visibility
        /// </summary>
        public Visibility AntePostMeridiemVisibility
        {
            get { return Visibility.Collapsed; }
        }

        /// <summary>
        /// Gets the running indication
        /// </summary>
        public bool IsRunning
        {
            get { return this.timer.IsEnabled; }
        }

        /// <summary>
        /// Gets the fact whether the clock shows seconds or not
        /// </summary>
        public bool HasSeconds
        {
            get { return true; }
        }
    }
}
